package com.liang.mybatis;

import com.liang.mybatis.mapper.UserMapper;
import com.liang.mybatis.pojo.User;
import com.liang.mybatis.utils.MybatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class mybatisTest001 {
    public static void main(String[] args) {
        SqlSession sqlSession = MybatisUtil.getSqlSession();
        UserMapper mapper = sqlSession.getMapper(UserMapper.class);
        List<User> list = mapper.getList();
        for (User user : list) {
            System.out.println(user);
        }

        sqlSession.close();
    }
}
